<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Three Word Phrase</title>
    <script type="text/javascript">
        var req;
        
        function parseInfo(body) {
            var reg;
            var offset;
            var match;

            // Countdown timer
            reg = /src=\"[\-a-z]+\.gif\"/g
            match = reg.exec(body);
            offset = match.index;

            reg = /\"[\-a-z]+\.gif\"/g
            reg.lastIndex = offset;
            match = reg.exec(body);
            dealEndTime = parseInt(match[0]);

            document.getElementById('comic').src = "http://www.threewordphrase.com/" + match[0].slice(1, match[0].length - 1);
        }

        // AJAX request.
        function ajaxResponse() {
            if (req.readyState == 4) {
                parseInfo(req.response);
            }
        }
        function ajaxRequestInfo() {
            req = new XMLHttpRequest();
            req.onreadystatechange = ajaxResponse;
            req.open("GET", "http://www.threewordphrase.com/index.htm", true);
            req.send();
        }

        // Google IO API request.
        function gioResponse(obj) {
            parseInfo(obj.text);
            gadgets.window.adjustHeight();
        }
        function gioRequestInfo() {
            var params = {};
            params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.TEXT;
            var url = "http://www.threewordphrase.com/index.htm";
            gadgets.io.makeRequest(url, gioResponse, params);
        }

        //requestStoreInfo();
    </script>
</head>
<body onload="ajaxRequestInfo()">
<div id="debug" style="width:300px;">
    <a href="http://www.threewordphrase.com/" target="_black">
	    <img id="comic" src="" onload="gadgets.window.adjustHeight()" \>
    </a>
	<br/>
	<div style="height:24px"/>
</div>
</body>
</html>
